package com.latefly.skewwork.ui.page.home

import androidx.compose.foundation.layout.Column
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavHostController
import com.latefly.skewwork.data.consts.PageIndex
import com.latefly.skewwork.ui.layout.LayoutViewModel
import com.latefly.skewwork.ui.layout.MainLayout
import com.latefly.skewwork.ui.page.resource.Resource
import com.latefly.skewwork.ui.page.self.Self
import com.latefly.skewwork.ui.page.tools.Tools

@Composable
fun HomePage(
    navController: NavHostController,
    modifier: Modifier,
    layoutViewModel: LayoutViewModel
) {
    MainLayout(
        navController = navController,
        content = {
            when (layoutViewModel.pageIndex.component1().description) {
                PageIndex.Blog.description -> {
                    Home(navController)
                }
                PageIndex.Resource.description -> {
                    Resource(navController)
                }
                PageIndex.Tools.description -> {
                    Tools(navController)
                }
                PageIndex.Self.description -> {
                    Self(navController)
                }
            }
        },
        layoutViewModel = layoutViewModel
    )
}

@Composable
fun Home(
    navController: NavHostController,
    modifier: Modifier = Modifier
) {
    Column {
//        Row {
//            Chip(text = "AAAAAAAA")
//            Button(
//                onClick = {
//                    navController.navigate("Test")
//                }, modifier = Modifier
//                    .padding(horizontal = 16.dp)
//                    .height(48.dp)
//                    .fillMaxWidth()
//            ) {
//                Text(text = "To Test Page!")
//            }
//        }
//        StaggeredGridBodyContent()
//        ConstrainLayoutContent()
//        ConstrainLayoutContent2()
//        LargeTextContent()
//        DecoupleApi()
//        IntrinsicsDemo()
        Text(text = "Home Page")
    }
}